<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学生主页</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
    <style>
        body {
            background-color: #f8f9fa;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .container {
            max-width: 600px;
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        h1 {
            margin-bottom: 20px;
            font-weight: 300;
            color: #343a40;
            font-size: 1.5rem;
            text-align: center;
        }
        .card {
            padding: 20px;
            border: none;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        .form-label {
            font-weight: 500;
            color: #495057;
            font-size: 0.9rem;
            text-align: left;
            display: block;
        }
        .form-control {
            border-radius: 4px;
            font-size: 0.9rem;
            width: 100%;
            box-sizing: border-box;
        }
        .btn {
            background-color: #007bff;
            color: white;
            border-radius: 4px;
            width: 100%;
        }
        .btn:hover {
            background-color: #0056b3;
        }
        .alert-info {
            background-color: #cce5ff;
            color: #004085;
            border-color: #b8daff;
            font-size: 0.9rem;
            border-radius: 4px;
        }
    </style>
</head>
<body>
    <div class="container mt-5">
        <h1>欢迎，学生 {{ username }}！</h1>
        <div class="card">
            <form action="/student_dashboard/{{ username }}" method="POST">
                <div class="mb-3">
                    <label for="class_name" class="form-label">输入要加入的班级名称:</label>
                    <input type="text" id="class_name" name="class_name" class="form-control" value="{{ class_name }}" required>
                </div>
                <button type="submit" class="btn">加入班级</button>
            </form>
        </div>
        {% if not class_name %}
            <div class="alert alert-info text-center mt-4">
                当前没有可加入的班级。
            </div>
        {% endif %}
    </div>
</body>
</html>
